package org.wyq.myweb.jmx.service.imple;

import java.lang.management.CompilationMXBean;
import java.lang.management.ManagementFactory;

import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.wyq.myweb.jmx.beaninfo.IInfoBean;
import org.wyq.myweb.jmx.service.IMXBeanService;


@Service("compilemx")
@Lazy(true)
public class DefaultCompileMBeanService implements IMXBeanService {
	
	CompilationMXBean compilationMXBean = ManagementFactory.getCompilationMXBean();

	@Override
	public <T extends IInfoBean> T getInfoBean() {
		return null;
	}

	
	
	public static void main(String[] args){
		DefaultCompileMBeanService s = new DefaultCompileMBeanService();
		System.out.println(s.compilationMXBean.getName());
		System.out.println(s.compilationMXBean.getTotalCompilationTime());
		System.out.println(s.compilationMXBean.getObjectName());
		System.out.println(s.compilationMXBean.isCompilationTimeMonitoringSupported());
	}
	
}
